import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { IToolTipItem } from "../../../../com/mui/manager/IToolTipItem";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
import { BaseItem } from "../common/BaseItem";
import { PlayerAndItemInfo } from "./PlayerAndItemInfo";
import { ColorConfig } from "../../resource/ColorConfig";
import { Language } from "../../../../extend/language/Language";
import { ToolTipInfo } from "../../model/ToolTipInfo";
import { NormalTooltip } from "../common/tooltip/NormalTooltip";
//class LuckyShowRenderer
    
    export  class LuckyShowRenderer extends GCellRenderer implements IToolTipItem
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ configUI(): void
        {
            var loc1=GlobalClass.getBitmap(ImagesConst.PackItemBg);
            addChild(loc1);
            this._item = new BaseItem();
            this._item.setSize(33, 33);
            this._item.move(2, 2);
            this._item.isDragAble = false;
            this._item.isDropAble = false;
            this._item.isShowLock = true;
            addChild(this._item);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            super.data = arg1;
            if (arg1 && arg1 is PlayerAndItemInfo) 
            {
                this._playerAndItem = arg1 as PlayerAndItemInfo;
                loc1 = this._playerAndItem.itemData;
                this._item.itemData = loc1;
                this._item.toolTipData = null;
                loc2 = [];
                loc3 = "<p align=\'center\'><font color=\'" + ColorConfig.instance.getItemColorString(loc1.color) + "\'> " + loc1.itemInfo.item.name + "</font></p>\n";
                loc2.push(loc3);
                loc3 = "<font color=\'#ffff00\'> " + Language.getString(35012) + "：</font>" + "<font color=\'#b1efff\'>" + this._playerAndItem.player.miniPlayer.name + "</font>";
                loc2.push(loc3);
                toolTipData = new ToolTipInfo(NormalTooltip.ToolTipRenderType_Separate, loc2);
            }
            return;
        }

        /* internal */ /* var */_item: BaseItem;

        /* internal */ /* var */_playerAndItem: PlayerAndItemInfo;
    }
